const fs = require('fs')
console.log(fs)
fs.readFile('./data.txt', 'utf-8', (err, data) => {
    console.log(err, '错误')
    console.log(data, '内容')
    if (!err) {
        const newData = data + 'Nancy'
        fs.writeFile('./data.txt', newData, (err) => {
            if (!err) {
                console.log('append success')
            }
        })
    }
})
// fs.writeFile('./data.txt', '嘿嘿', (err) => {
//     console.log(err, '写入')
// })

